document.addEventListener("DOMContentLoaded", init, false);

function init() {
    layui.use(["element", 'jquery']);
    getAdmin((data) => {
        $(".userHeadImg").attr("src", isEmpty(data.headImg) ? "/img/nullHeadImg.png" : data.headImg).after(data.name);
        fillDict();
    });
}

/* 退出登录 */
function logout() {
    ajax("/back/admin/logout", "DELETE", "", () => {
        $.cookie("loginToken", null, {path: "/"});
        window.location.replace("/login");
    })
}
